package com.topone.service;

import com.topone.Form.CouponOrderForm;
import com.topone.dataObject.OrderMaster;
import com.topone.dto.BussinessDTO;
import com.topone.dto.OrderDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/12/4,0004.
 */
public interface OrderService {
    //创建订单
    OrderDTO create(CouponOrderForm couponOrderForm);

    //查询单个订单
    OrderDTO findOne(String orderId);

    //查询单个订单
    OrderDTO findOrderMaster(String orderId);

    //查询订单列表
    Page<OrderDTO> findList(String buyerOpenid, Pageable pageable);

    //取消订单
    OrderDTO cancel(OrderDTO orderDTO);

    //完结订单
    OrderDTO finish(OrderDTO orderDTO);

    //完结订单(支付)
    OrderDTO finishPay(OrderDTO orderDTO);

    //支付订单
    OrderDTO paid(OrderDTO orderDTO);

    //查询订单列表
    List<OrderDTO> findList(Integer orderStatus);

    //查询用户未支付订单
    List<OrderDTO> findUnpayOrderList(String openid);

    //计算支付总价
    Map<String,Object> calculateAmount(String couponId, String couponNum, String couponPrice, String couponAmount);

    //商家显示订单信息
    Map<String,Object> findOrdersByBusiness(BussinessDTO bussinessDTO);

    List<OrderDTO> findAllByStatus(Integer status);

     //用户扫码核销券
    OrderMaster checkUserCoupon(String amount, String openid);

    //支付优惠券(包括再次唤起支付)
    Map<String,Object> purchaseCoupon(OrderDTO orderDTO,String bussinessId);


}
